﻿
Public Class SnapshotVolume
    Public Property Volume As String
    Public Property SnapshotGuid As Guid
    Public Property SnapshotDeviceObject As String

    Sub New()
        MyBase.new()
    End Sub
    Sub New(ByVal Volume As String, ByVal SnapshotGuid As Guid)
        MyBase.New()
        Volume = Volume
        SnapshotGuid = SnapshotGuid
    End Sub
End Class


Public Class SnapshotVolumeCollection
    Inherits System.Collections.ObjectModel.Collection(Of SnapshotVolume)

    Public Function ContainsVolume(ByVal Volume As String) As Boolean
        Dim iEnum = Me.GetEnumerator

        While iEnum.MoveNext()
            Dim sv As SnapshotVolume = iEnum.Current
            If sv.Volume = Volume Then Return True
        End While

        Return False

    End Function

    Public Function GetSnapshotVolume(ByVal Volume As String) As SnapshotVolume
        Dim iEnum = Me.GetEnumerator

        While iEnum.MoveNext()
            Dim SnapshotVolume As SnapshotVolume = iEnum.Current
            If SnapshotVolume.Volume = Volume Then Return SnapshotVolume
        End While

        Return Nothing

    End Function

End Class

